1. Field of the Invention
The invention relates to video processing, and more particularly to video encoding.
2. Description of the Related Art
Video data comprises a series of frames, wherein each frame is a picture and is divided into a plurality of blocks to be respectively encoded. A video block may be encoded in an intra-mode or an inter-mode. In the intra-mode, pixels of a video block are compared with pixels of neighboring blocks to reduce the data amount to be encoded. In the inter-mode, pixels of a video block of a current frame are compared with pixels of a corresponding block of a reference frame to reduce the data amount to be encoded.
Referring to FIG. 1A, a block diagram of a video encoder 100 encoding video data according to an intra-mode is shown. The video encoder 100 comprises an intra-prediction module 102, a subtraction module 104, a transform module 106, and a quantizer 108. A video block is first delivered to the intra-prediction module 102. The intra-prediction module 102 performs intra-prediction to generate a predicted block according to pixels of blocks neighboring to the video block. The intra-prediction module 102 performs intra-prediction according to one of a plurality of intra-prediction modes. FIG. 2 is a schematic diagram of nine intra-prediction modes 0-8 according to the VCEG-N54 standard. Each intra-prediction mode generates pixel values of a predicted block according to different neighboring pixels. The subtraction module 104 then subtracts pixel values of the predicted block from pixel values of the video block to obtain prediction residues of pixels of the video block. The transform module 106 then performs video data compression to convert the prediction residues of the video block to transform values with reduced data amount. For example, the transform module 106 may perform discrete cosine transform (DCT) or Karhunen-Loeve transform (KLT) on the prediction residues to obtain the transform values. The quantizer 108 then quantizes the transform values to quantized values with further reduced data amount suitable for storage or transmission.
Referring to FIG. 1B, a block diagram of a video decoder 150 decoding video data according to an intra-mode is shown. In one embodiment, the video decoder 150 comprises an inverse transform module 152, an inverse intra-prediction module 154, and a summation module 156. The inverse transform module 152 performs video data decompression to convert quantized values of the video block to prediction residues. The inverse intra-prediction module 154 performs intra-prediction according to an intra-prediction mode to generate a predicted block. The summation module 156 then adds the prediction residues to the predicted block to obtain a reconstructed block. The reconstructed block is then output for display.
The video encoder 100 shown in FIG. 1A, however, has shortcomings First, when intra-prediction is performed, the intra-prediction module 102 generates a predicted block corresponding to a current block according to pixel values of neighboring blocks. Pixel values of the predicted block are therefore related to pixel values of the neighboring blocks. Intra-prediction modes corresponding to the neighboring blocks and the current block, however, are independently determined. The predicted blocks corresponding to the neighboring blocks and the current blocks therefore are often generated according to different intra-prediction modes, leading to discontinuous change in predicted block values corresponding to the neighboring blocks and the current blocks. A method for performing intra-prediction on a current block according to intra-prediction modes of neighboring blocks is therefore required. In addition, the transform module 106 performs video data compression according to only one set of transform coefficients. Intra-prediction residues obtained according to different intra-prediction modes, however, require different transform coefficients to best suit properties of the different intra-prediction modes. A method for performing video data compression according to different transform coefficients corresponding to different intra-prediction modes is therefore required.